<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="css/amazeui.min.css">
    <link rel="stylesheet" href="css/petshow.css?6">
    <link rel="stylesheet" href="css/animate.min.css">
    <script src="js/jquery.min.js"></script>
    <script src="js/amazeui.min.js"></script>
    <script src="js/amazeui.lazyload.min.js"></script>
    <script src="js/jquery-2.1.4.min.js" ></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>首页-商家</title>
<body>
<table id="table" border="1px red solid">


</table>

<script>
    var table=document.getElementById("table");
    $.ajax({
        type:"GET",
        url:"http://192.168.43.116:9523/eto/dishes/list", //访问的链接
        dataType:"json",  //数据格式设置为jsonp
        //jsonp:"callback",  //Jquery生成验证参数的名称

        success:function(data){  //成功的回调函数
            console.log(data);
            for(key in data){
                var tr=document.createElement("tr");
                var th=document.createElement("th");


                var td1=document.createElement("td");
                var text1=document.createTextNode(data[key]["dishNo"])
                td1.appendChild(text1);


                var td2=document.createElement("td");
                var td3=document.createElement("td");
                var td4=document.createElement("td");
                var td5=document.createElement("td");



                var text2=document.createTextNode(data[key]["dishName"]);

                var text3=document.createTextNode(data[key]["dishTypeNumber"]);
                var text4=document.createTextNode(data[key]["dishPicture"]);
                var text5=document.createTextNode(data[key]["dishPrice"]);



                td2.appendChild(text2);
                td3.appendChild(text3);
                td4.appendChild(text4);
                td5.appendChild(text5);





                th.appendChild(td1);
                th.appendChild(td2);

                th.appendChild(td3);

                th.appendChild(td4);

                th.appendChild(td5);

      tr.appendChild(th);
                table.appendChild(tr);


            }
        },
        error: function (e) {
            console.log(e);
        }
    });




</script>








</body>
   </html>